import {get,post} from "./http.js"

// 获取后台接口
//---------------------菜单---------------
// 菜单添加
export const menuAdd =(params)=>post("/api/menuadd",params)
//菜单列表
export const menuList  =(params)=>get("/api/menulist",params)
//删除功能
export const menuDel= (params)=>post("/api/menudelete",params)
//菜单获取(一条)
export const menuInfo = (params)=>get("/api/menuinfo",params)
//菜单修改
export const menuEdit = (params)=>post("/api/menuedit",params)
// -----------------角色----------------
export const roleAdd = (params)=>post("/api/roleadd",params)
export const rolelist = (params)=>get("api/rolelist",params)
export const roleDel =(params)=>post("/api/roledelete",params)
export const roleInfo  =(params)=>get("/api/roleinfo",params)
export const roleEdit = (params)=>post("/api/roleedit",params)
// ------------------管理员--------------------------
export const mgeAdd = (params)=>post("/api/useradd",params)

export const mgeList = (params)=> get("/api/userlist",params)
// 删除
export const msgDel = (params)=> post("/api/userdelete",params)
// 获取一条信息
export const msgInfo = (params)=> get("/api/userinfo",params)
// 编辑
export const msgEdit = (params)=> post("/api/useredit",params)

// 管理员登录
export const login = (params)=> post("/api/userlogin",params)




// 管理员总数
export const msgCount = ()=> get("/api/usercount")
// ====================商品分类=======================
export const cateAdd = (params)=>post("/api/cateadd",params,true)
export const cateList =(params)=>get("/api/catelist",params)
export const cateEdit  =(params)=>post("/api/cateedit",params,true)
export const cateInfo =(params)=>get("/api/cateinfo",params)
export const cateDel=(params)=>post("/api/catedelete",params)
// =================商品规格=====================
export const specsList  =(params)=>get("/api/specslist",params)
export const specsAdd = (params)=>post("/api/specsadd",params)
export const specscount  =(params)=>get("/api/specscount",params)
export const specsDel = (params)=>post("/api/specsdelete",params)
export const specsInfo = (params)=>get("/api/specsinfo",params)
export const specsEdit = (params)=>post("/api/specsedit",params)
// ==================商品管理========================
export const goodsList = (params)=>get("/api/goodslist",params)
export const goodsAdd = (params)=>post("/api/goodsadd",params,true)
export const goodsDel =(params)=>post("/api/goodsdelete",params)
export const goodsInfo = (params)=>get("/api/goodsinfo",params)
export const goodsEdit = (params)=>post("/api/goodsedit",params,true)
export const goodscount = (params)=>get("/api/goodscount",params)
// =======================会员管理=====================
export const memberlist = ()=>get("/api/memberlist")
export const memberinfo = (params)=>get("/api/memberinfo",params)
export const memberedit = (params)=>post("/api/memberedit",params)

// ======================轮播图管理======================
export const bannerAdd = (params)=>post("/api/banneradd",params,true)
export const bannerList = ()=>get("/api/bannerlist")
export const bannerInfo =(params)=>get("/api/bannerinfo",params)
export const bannerEdit = (params)=>post("/api/banneredit",params,true)
export const bannerDel =(params)=>post("/api/bannerdelete",params)
// ====================秒杀活动=====================
//秒杀添加
export const seckadd = (params)=>post("/api/seckadd",params)
//秒杀列表
export const secklist = ()=>get("/api/secklist")
//获取一条秒杀
export const seckinfo = (params)=>get("/api/seckinfo",params)
//限时秒杀修改
export const seckedit = (params)=>post("/api/seckedit",params)
//限时秒杀删除
export const seckdel = (params)=>post("/api/seckdelete",params)